<template>
  <div class="bottom">
    <div class="contant">
      <i
        class="check"
        :class="{ active: $store.state.checkedAll }"
        @click="selectAll"
      ></i>
      <span class="selectnum">已选({{ $store.state.checked }})</span>
      <slot />
    </div>
  </div>
</template>
<script>
export default {
  name: "CartBottomBar",
  // data() {
  //     return {
  //         count: 0,
  //     }
  // },
  created() {
    this.$store.commit("sumPrice");
    this.$store.commit("sumChecked");
  },
  methods: {
    selectAll() {
      this.$store.dispatch("selectAll");
    },
  },
};
</script>
<style scoped>
.bottom {
  position: fixed;
  height: 59px;
  width: 100%;
  bottom: 49px;
  z-index: 3;
  padding-left: 15px;
  background-color: #fff;
  border-top: 1px solid #d8c7c7;
}
.bottom .contant {
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
  line-height: 59px;
}
.check {
  float: left;
  width: 19px;
  height: 19px;
  margin-right: 8px;
  margin-top: 19px;
  background-image: url(~assets/images/cart/checkbox.webp);
  background-size: 19px 286.5px;
  background-position: 0 -267.5px;
}
.bottom .contant .active {
  background-size: 19px 286.5px;
  background-position: 0 -116px;
}
.contant .selectnum {
  float: left;
  color: #7f7f7f;
}
</style>